package com.yjd.user.restful.service;

import com.yjd.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 用户登陆服务
 * Created by yangchangyan@yijiedai.com on 2018-12-25 14:30.
 */
@FeignClient(value = "${user.service.application.name}")
public interface ILoginRsService {

  /**
   * 登陆 restful风格URI
   * @param username
   * @param password
   * @throws Exception
   */
  @RequestMapping("/login/{username}/{password}")
  User login(
    @PathVariable("username") String username,
    @PathVariable("password") String password
  ) throws Exception;

  /**
   * 登陆 json格式消息体
   * @param user
   * @return
   * @throws Exception
   */
  @RequestMapping("/login")
  User login(@RequestBody User user) throws Exception;

}
